home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Source / winterp-1.13 / src-server / winterp.h < prev   
Encoding:
C/C++ Source or Header  |  1991-10-04  |  4.2 KB  |  106 lines

  1. /* -*-C-*-
  2. ********************************************************************************
  3. *
  4. * File:         winterp.h
  5. * RCS:          $Header: winterp.h,v 1.9 91/04/22 00:25:33 mayer Exp $
  6. * Description:  Miscellaneous macros, #defines, etc
  7. * Author:       Niels Mayer, HPLabs
  8. * Created:      Wed Aug 31 14:09:08 1988
  9. * Modified:     Fri Oct  4 03:22:45 1991 (Niels Mayer) mayer@hplnpm
  10. * Language:     C
  11. * Package:      N/A
  12. * Status:       X11r5 contrib tape release
  13. *
  14. * WINTERP Copyright 1989, 1990, 1991 Hewlett-Packard Company (by Niels Mayer).
  15. * XLISP version 2.1, Copyright (c) 1989, by David Betz.
  16. *
  17. * Permission to use, copy, modify, distribute, and sell this software and its
  18. * documentation for any purpose is hereby granted without fee, provided that
  19. * the above copyright notice appear in all copies and that both that
  20. * copyright notice and this permission notice appear in supporting
  21. * documentation, and that the name of Hewlett-Packard and David Betz not be
  22. * used in advertising or publicity pertaining to distribution of the software
  23. * without specific, written prior permission.  Hewlett-Packard and David Betz
  24. * make no representations about the suitability of this software for any
  25. * purpose. It is provided "as is" without express or implied warranty.
  26. *
  27. * HEWLETT-PACKARD AND DAVID BETZ DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
  28. * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
  29. * IN NO EVENT SHALL HEWLETT-PACKARD NOR DAVID BETZ BE LIABLE FOR ANY SPECIAL,
  30. * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  31. * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  32. * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  33. * PERFORMANCE OF THIS SOFTWARE.
  34. *
  35. * See ./winterp/COPYRIGHT for information on contacting the authors.
  36. * Please send modifications, improvements and bugfixes to mayer@hplabs.hp.com
  37. * Post XLISP-specific questions/information to the newsgroup comp.lang.lisp.x
  38. *
  39. ********************************************************************************
  40. */
  41.  
  42. #define WINTERP_VERSION_INT 1
  43. #define WINTERP_REVISION_INT 13
  44.  
  45. /*----------------------------------------------------------------------------
  46.  * Kludges to sweeten Xt's ugly argument processing for widget creation.
  47.  *---------------------------------------------------------------------------*/
  48. extern Arg _args[];        /* global in winterp.c */
  49. extern int _num_args;        /* global in winterp.c */
  50.  
  51. #define ARGLIST_RESET() \
  52.   _num_args = 0
  53.  
  54. #define ARGLIST_ADD(name, value) \
  55.   XtSetArg(_args[_num_args], (name), (value)); _num_args++
  56.  
  57. #define ARGLIST_SET_LAST_ELT(name, value) \
  58.   XtSetArg(_args[(_num_args - 1)], (name), (value))
  59.  
  60. #define ARGLIST() \
  61.   _args, _num_args
  62.  
  63.  
  64. /* Setup cpp symbols for conditional compilation of Motif 1.0 vs Motif 1.1 */
  65.  
  66. #if (XmVersion >= 1001)        /* XmVersion from <Xm/Xm.h> */
  67. #define WINTERP_MOTIF_11
  68. #endif
  69.  
  70. #ifndef WINTERP_MOTIF_11    /* Motif 1.0 backwards compatibility */
  71. typedef unsigned char XtEnum;
  72. #endif
  73.  
  74. #ifndef WINTERP_MOTIF_11    /* Motif 1.0 backwards compatibility */
  75. typedef char* XtPointer;
  76. #endif
  77.  
  78. /*
  79.  * Motif 1.1.1 has some changes over version 1.1 that are important enough to
  80.  * require #ifdefs in the code. Gratuitous, consistency-violating alterations
  81.  * to the API were made in fixing the 1.1 bugs. Because Motif 1.1 and Motif 1.1.1
  82.  * cannot be identified through any sort of documented means, I had to resort
  83.  * to a hack, in the truest sense of the word, in order to work around this
  84.  * charming detail. The hack to determine which version of Motif 1.1 you're
  85.  * running: 1.1.1 defines the new symbol XmDYNAMIC_DEFAULT_TAB_GROUP, and
  86.  * 1.1 doesn't... The presence of that symbol tells WINTERP that we're using
  87.  * 1.1.1 and defines WINTERP_MOTIF_111. This is used in a few places in
  88.  * w_resources.c, for example.
  89.  */
  90. #ifdef WINTERP_MOTIF_11
  91. #ifdef XmDYNAMIC_DEFAULT_TAB_GROUP
  92. #define WINTERP_MOTIF_111
  93. #endif                /* XmDYNAMIC_DEFAULT_TAB_GROUP */
  94. #endif                /* WINTERP_MOTIF_11 */
  95.  
  96. /*
  97.  * Motif 1.1.3 defines two new symbols, XmCR_CREATE and XmCR_PROTOCOLS, use
  98.  * these to tell us we're running 1.1.3...
  99.  */
  100. #ifdef WINTERP_MOTIF_11
  101. #ifdef XmCR_CREATE
  102. #define WINTERP_MOTIF_113
  103. #endif /* XmCR_CREATE */
  104. #endif /* WINTERP_MOTIF_11 */
  105.